# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2023/4/24 16:23
# @Author : xyjiang1216
# @Email : jiangxuyan@nudt.edu.cn
# @File : solver_interface.py
# @Version: OpenPlanner2.0
from abc import abstractmethod, ABCMeta
from typing import List

from OpenPlanner.core.api.algo_input_class import Link, Stream, Instance


class PlanningStrategy(metaclass=ABCMeta):
    """定义规划算法的接口类"""
    def __init__(self,
                 link_array: List[Link],
                 stream_array: List[Stream],
                 instance_array: List[List[List[Instance]]],
                 solution_txt: str,
                 **kwargs):
        # kargs是其他全局参数，例如时间同步精度等
        self.link_array = link_array
        self.stream_array = stream_array
        self.instance_array = instance_array
        self.solution_txt = solution_txt
        self.kwargs = kwargs

    @abstractmethod
    def do_planning(self):
        """
        定义接口名。
        返回值应当符合时空资源描述表的定义。
        :return:
        """
        return
